<?php

// Get variables
$interest_name 	= get_input('interest_name');
$category_id	= get_input('category_id');

//$interest = get_interest_by_name($interest_name);
$interest = get_interest_by_name_and_category_id($interest_name, $category_id);

if ($interest) {
    $result = export_result(200, to_interest_array($interest));
} else {
    $result = export_result(400, array());
}

echo json_encode($result); 

?>